import request from "@/utils/request";
/**
 *
 * @param {number} id
 * @param {import('vue').Component} component
 */
function deleteManuscript(id, component) {
  request.delete(`/system/manuscript/${id}`).then((res) => {
    console.log(res);
    component.$message.success("删除成功");
    if (component.confirm) {
      component.confirm();
    }
  });
}

function listByOrderId(param, component) {
  return new Promise((resolve) => {
    request.post("/system/manuscript/listByOrderId", param).then((res) => {
      component.normalManuscript = res.data;
      resolve(res.data);
    });
  });
}

export { deleteManuscript, listByOrderId };
